package com.scy.java.object.abstractTest.firm;
//小时工-兼职
public class HourlyEmployee extends Employee{
    private double wage;//每小时的工资
    private int hour;//月工作的小时数

    public HourlyEmployee(String name, Integer number,
           MyDate birthday, double wage, int hour) {
        super(name, number, birthday);
        this.wage = wage;
        this.hour = hour;
    }

    @Override
    public double earning() {
        return  wage*hour;
    }

    public double getWage() {
        return wage;
    }

    public void setWage(double wage) {
        this.wage = wage;
    }

    public int getHour() {
        return hour;
    }

    public void setHour(int hour) {
        this.hour = hour;
    }

    @Override
    public String toString() {
        return "HourlyEmployee{" +
                super.toString()+
                '}';
    }
}
